package com.yc.tc.beans;

import java.io.Serializable;

public class OrderInfo implements Serializable {
	private static final long serialVersionUID = 1L;

	private int oid; // 订单编号
	private int usid;
	private int jbid;
	private String odate; // 游玩日期
	private int status; // 支付状态
	private int number;
	private String otime;
	private String temp;
	private String flag;
	private double flags;

	public String getStatuss() {
		if (this.status == 1) {
			return "已支付";
		} else if (this.status == 2) {
			return "未支付";
		} else {
			return "已取消";
		}
	}

	@Override
	public String toString() {
		return "OrderInfo [oid=" + oid + ", usid=" + usid + ", jbid=" + jbid
				+ ", odate=" + odate + ", status=" + status + ", number="
				+ number + ", otime=" + otime + ", temp=" + temp + ", flag="
				+ flag + ", flags=" + flags + "]";
	}

	public OrderInfo(int oid, int usid, int jbid, String odate, int status,
			int number, String otime, String temp, String flag, double flags) {
		super();
		this.oid = oid;
		this.usid = usid;
		this.jbid = jbid;
		this.odate = odate;
		this.status = status;
		this.number = number;
		this.otime = otime;
		this.temp = temp;
		this.flag = flag;
		this.flags = flags;
	}

	public OrderInfo() {
		super();
	}

	public int getOid() {
		return oid;
	}

	public void setOid(int oid) {
		this.oid = oid;
	}

	public int getUsid() {
		return usid;
	}

	public void setUsid(int usid) {
		this.usid = usid;
	}

	public int getJbid() {
		return jbid;
	}

	public void setJbid(int jbid) {
		this.jbid = jbid;
	}

	public String getOdate() {
		return odate;
	}

	public void setOdate(String odate) {
		this.odate = odate;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public String getOtime() {
		return otime;
	}

	public void setOtime(String otime) {
		this.otime = otime;
	}

	public String getTemp() {
		return temp;
	}

	public void setTemp(String temp) {
		this.temp = temp;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}


	public double getFlags() {
		return Math.ceil(flags);
	}


	public void setFlags(double flags) {
		this.flags = flags;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((flag == null) ? 0 : flag.hashCode());
		long temp;
		temp = Double.doubleToLongBits(flags);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + jbid;
		result = prime * result + number;
		result = prime * result + ((odate == null) ? 0 : odate.hashCode());
		result = prime * result + oid;
		result = prime * result + ((otime == null) ? 0 : otime.hashCode());
		result = prime * result + status;
		result = prime * result
				+ ((this.temp == null) ? 0 : this.temp.hashCode());
		result = prime * result + usid;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		OrderInfo other = (OrderInfo) obj;
		if (flag == null) {
			if (other.flag != null)
				return false;
		} else if (!flag.equals(other.flag))
			return false;
		if (Double.doubleToLongBits(flags) != Double
				.doubleToLongBits(other.flags))
			return false;
		if (jbid != other.jbid)
			return false;
		if (number != other.number)
			return false;
		if (odate == null) {
			if (other.odate != null)
				return false;
		} else if (!odate.equals(other.odate))
			return false;
		if (oid != other.oid)
			return false;
		if (otime == null) {
			if (other.otime != null)
				return false;
		} else if (!otime.equals(other.otime))
			return false;
		if (status != other.status)
			return false;
		if (temp == null) {
			if (other.temp != null)
				return false;
		} else if (!temp.equals(other.temp))
			return false;
		if (usid != other.usid)
			return false;
		return true;
	}

}
